//
//  RegBarsAppDelegate_iPhone.m
//  RegBars
//
//  Created by Huu Nhat on 7/25/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "RegBarsAppDelegate_iPhone.h"

@implementation RegBarsAppDelegate_iPhone
@synthesize navViewController;
@synthesize stateViewController;
@synthesize routeMapView;
@synthesize resbarDetailController;

- (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
	[self.window addSubview:navViewController.view];
    [navViewController.view setFrame:CGRectMake(0, 0, 320, 480)];
	[self.window makeKeyAndVisible];
	if ([self connectedToNetwork]) {
		[super application:application didFinishLaunchingWithOptions:launchOptions];
	}else {
		UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Message" message:@"Connot connect internet, please check your network connection" delegate:nil cancelButtonTitle:@"Close" otherButtonTitles:nil];
		[alert show];
		[alert release];
	}
    self.resbarDetailController = [[RestaurantDetailViewController alloc] initWithNibName:@"RestaurantDetailViewController" bundle:[NSBundle mainBundle]];
	
	return YES;
}

- (void)dealloc{
    [routeMapView release];
    self.stateViewController = nil;
    self.navViewController = nil;
    [resbarDetailController release];
    [super dealloc];
}	
@end
